package cn.hxzy.mapper;

import cn.hxzy.domain.vo.StudentVo;
import cn.hxzy.domain.vo.StudentVo2;
import cn.hxzy.response.R;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author wangboyu
 * @Description TODO
 * @Date 2024/6/27 18:11
 */
@Mapper
public interface TeacherMapper extends BaseMapper<StudentVo> {

    @Update("update sys_user set nike_name=#{nikeName},user_phone=#{userPhone},user_email=#{userEmail},user_no=#{userNo},major_name=#{majorName},admission_year=#{admissionYear},remark=#{remark} where user_id=#{userId}")
    R updateStudent(StudentVo studentVo);

    //查询老师名下的所有学生
    @Select("SELECT * FROM sys_user WHERE user_type = #{userType}")
    List<StudentVo2> selectStudentByTeacher(String userType);
}
